Ch. 1 Linear Algebra

Return to TOC

Determinants

abcd=adbc \begin{vmatrix} a & b \\ c & d \end{vmatrix} =ad-bc

abcdefghi=aeiafhbdi+bfg+cdhceg \begin{vmatrix} a & b & c \\ d & e & f \\ g & h & i \\ \end{vmatrix} = aei-afh-bdi+bfg+cdh-ceg
Determinants of 3x3 matrices can be determined in two ways: Cofactor Method and Basket Weaving Method

Cofactor Method

  1. Choose a row or column (henceforth referred to as NN)

  2. Find the minor of each element in NN

  3. Multiply each element by its respective minor and add or subtract based on this pattern [+++++]\begin{bmatrix}+&-&+\\-&+&-\\+&-&+\end{bmatrix}

Example 1.1 & 1.2

Evaluate 123456789\begin{vmatrix}-1&2&3\\4&5&-6\\-7&8&9\end{vmatrix} using the cofactor method.


Example 1.1 Using top row 123456789\begin{vmatrix}\textcolor{#EE4266}{-1}&\textcolor{#EE4266}{2}&\textcolor{#EE4266}{3}\\4&5&-6\\-7&8&9\end{vmatrix} 1. Elements are 1\textcolor{#EE4266}{-1}, 2\textcolor{#EE4266}{2}, 3\textcolor{#EE4266}{3}
2. Calculate minors
2a. Minor for 1-1 is 5689=(5)(9)(6)(8)=93\begin{vmatrix}5&-6\\8&9\end{vmatrix}=(5)(9)-(-6)(8)=\textcolor{#C2FBEF}{93}
2b. Minor for 22 is 4679=(4)(9)(6)(7)=6\begin{vmatrix}4&-6\\-7&9\end{vmatrix}=(4)(9)-(-6)(-7)=\textcolor{#C2FBEF}{-6}
2c. Minor for 33 is 4578=(4)(8)(5)(7)=67\begin{vmatrix}4&5\\-7&8\end{vmatrix}=(4)(8)-(5)(-7)=\textcolor{#C2FBEF}{67}
3. (1)(93)(2)(6)+(3)(67)=120(-1)(\textcolor{#C2FBEF}{93})-(2)(\textcolor{#C2FBEF}{-6})+(3)(\textcolor{#C2FBEF}{67})=120
Example 1.2 Using middle column 123456789\begin{vmatrix}-1&\textcolor{#EE4266}{2}&3\\4&\textcolor{#EE4266}{5}&-6\\-7&\textcolor{#EE4266}{8}&9\end{vmatrix} 1. Elements are 2\textcolor{#EE4266}{2}, 5\textcolor{#EE4266}{5}, 8\textcolor{#EE4266}{8}
2. Calculate minors
2a. Minor for 22 is 4679=(4)(9)(6)(7)=6\begin{vmatrix}4&-6\\-7&9\end{vmatrix}=(4)(9)-(-6)(-7)=\textcolor{#C2FBEF}{-6}
2b. Minor for 55 is 1379=(1)(9)(3)(7)=12\begin{vmatrix}-1&3\\-7&9\end{vmatrix}=(-1)(9)-(3)(-7)=\textcolor{#C2FBEF}{12}
2c. Minor for 88 is 1346=(1)(6)(3)(4)=6\begin{vmatrix}-1&3\\4&-6\end{vmatrix}=(-1)(-6)-(3)(4)=\textcolor{#C2FBEF}{-6}
3. (2)(6)+(5)(12)(8)(6)=120-(2)(\textcolor{#C2FBEF}{-6})+(5)(\textcolor{#C2FBEF}{12})-(8)(\textcolor{#C2FBEF}{-6})=120

Basket Weaving Method

  1. Copy the first two columns to the right of the matrix
  2. Multiply the elements in each diagonal as shown in the image
  3. Add the ones going down, subtract the ones going up
Example 1.3

Evaluate 123456789\begin{vmatrix}-1&2&3\\4&5&-6\\-7&8&9\end{vmatrix} using the basket-weaving method


  1. 123124564578978\begin{vmatrix}-1&2&3&-1&2\\4&5&-6&4&5\\-7&8&9&-7&8\end{vmatrix}
  2. The products of the diagonals are:
  1. The first three are added and the last three are subtracted

Cramer's Rule

Method of solving a system of 3 linear equations of 3 variables
The system of equations
a1x+b1y+c1z=C1a2x+b2y+c2z=C2a3x+b3y+c3z=C3 a_1x+b_1y+c_1z=\textcolor{#F79256}{C_1}\\ a_2x+b_2y+c_2z=\textcolor{#F79256}{C_2}\\ a_3x+b_3y+c_3z=\textcolor{#F79256}{C_3}\\
can be represented in matrix form as
[a1b1c2a2b2c2a3b3c3][xyz]=[C1C2C3] \begin{bmatrix} a_1 & b_1 & c_2\\ a_2 & b_2 & c_2\\ a_3 & b_3 & c_3 \end{bmatrix} \begin{bmatrix} x\\y\\z \end{bmatrix} = \begin{bmatrix} \textcolor{#F79256}{C_1}\\\textcolor{#F79256}{C_2}\\\textcolor{#F79256}{C_3} \end{bmatrix}
and the solutions are
x=C1b1c1C2b2c2C3b3c3a1b1c2a2b2c2a3b3c3,y=a1C1c1a2C2c2a3C3c3a1b1c2a2b2c2a3b3c3,z=a1b1C1a2b2C2a3b3C3a1b1c2a2b2c2a3b3c3 x=\frac{\begin{vmatrix}\textcolor{#F79256}{C_1}&b_1&c_1\\\textcolor{#F79256}{C_2}&b_2&c_2\\\textcolor{#F79256}{C_3}&b_3&c_3\end{vmatrix}}{\begin{vmatrix}a_1&b_1&c_2\\a_2&b_2&c_2\\a_3&b_3&c_3\end{vmatrix}}, y=\frac{\begin{vmatrix}a_1&\textcolor{#F79256}{C_1}&c_1\\a_2&\textcolor{#F79256}{C_2}&c_2\\a_3&\textcolor{#F79256}{C_3}&c_3\end{vmatrix}}{\begin{vmatrix}a_1&b_1&c_2\\a_2&b_2&c_2\\a_3&b_3&c_3\end{vmatrix}}, z=\frac{\begin{vmatrix}a_1&b_1&\textcolor{#F79256}{C_1}\\a_2&b_2&\textcolor{#F79256}{C_2}\\a_3&b_3&\textcolor{#F79256}{C_3}\end{vmatrix}}{\begin{vmatrix}a_1&b_1&c_2\\a_2&b_2&c_2\\a_3&b_3&c_3\end{vmatrix}}

Example 1.4

Solve the following system using Cramer's Rule
12x4y+4z=210x+0y4z=612x+12y+4z=1 -12x-4y+4z=\textcolor{#F79256}{-21}\\ 0x+0y-4z=\textcolor{#F79256}{6}\\ 12x+12y+4z=\textcolor{#F79256}{-1}


The matrix form is
[124400412124][xyz]=[2161] \begin{bmatrix} -12&-4&4\\ 0&0&-4\\ 12&12&4 \end{bmatrix} \begin{bmatrix}x\\y\\z\end{bmatrix} =\begin{bmatrix} \textcolor{#F79256}{-21}\\ \textcolor{#F79256}{6}\\ \textcolor{#F79256}{-1} \end{bmatrix}
The denominator is the determinant of the 3x3 matrix
This is easily computed using cofactor method on the second row, taking advantage of the 00s
124400412124=0+0(4){(12)(12)(4)(12)}=384 \begin{vmatrix} -12&-4&4\\ 0&0&-4\\ 12&12&4 \end{vmatrix} =-0+0-(-4)\textcolor{#F79256}{\{}(-12)(12)-(-4)(12)\textcolor{#F79256}{\}}=\textcolor{#C2FBEF}{-384}
Finally, we can use the formula for each variable
Start with xx, using cofactor method on the second row
x=21446041124384=6{(4)(4)(4)(12)}+0(4){(21)(12)(4)(1)}384=3841024384=53 x=\frac{\begin{vmatrix}\textcolor{#F79256}{-21}&-4&4\\\textcolor{#F79256}{6}&0&-4\\\textcolor{#F79256}{-1}&12&4\end{vmatrix}}{\textcolor{#C2FBEF}{\textcolor{#C2FBEF}{-384}}}=\frac{-6\textcolor{#F79256}{\{}(-4)(4)-(4)(12)\textcolor{#F79256}{\}}+0-(-4)\textcolor{#F79256}{\{}(-21)(12)-(-4)(-1)\textcolor{#F79256}{\}}}{\textcolor{#C2FBEF}{-384}}=\frac{384-1024}{\textcolor{#C2FBEF}{-384}}=\frac{5}{3}
Next yy, using cofactor method on the second row
y=122140641214384=0+6{(12)(4)(4)(12)}(4){(12)(1)(21)(12)}384=0+(576)(1056)384=54 y=\frac{\begin{vmatrix}-12&\textcolor{#F79256}{-21}&4\\0&\textcolor{#F79256}{6}&-4\\12&\textcolor{#F79256}{-1}&4\end{vmatrix}}{\textcolor{#C2FBEF}{-384}}=\frac{-0+6\textcolor{#F79256}{\{}(-12)(4)-(4)(12)\textcolor{#F79256}{\}}-(-4)\textcolor{#F79256}{\{}(-12)(-1)-(-21)(12)\textcolor{#F79256}{\}}}{\textcolor{#C2FBEF}{-384}}=\frac{-0+(-576)-(-1056)}{\textcolor{#C2FBEF}{-384}}=-\frac{5}{4}
Finally zz, using cofactor method on the second row
z=1242100612121384=0+06{(12)(12)(4)(12)}384=0+0(576)384=32 z=\frac{\begin{vmatrix}-12&-4&\textcolor{#F79256}{-21}\\0&0&\textcolor{#F79256}{6}\\12&12&\textcolor{#F79256}{-1}\end{vmatrix}}{\textcolor{#C2FBEF}{-384}}=\frac{-0+0-6\textcolor{#F79256}{\{}(-12)(12)-(-4)(12)\textcolor{#F79256}{\}}}{\textcolor{#C2FBEF}{-384}}=\frac{-0+0-(-576)}{\textcolor{#C2FBEF}{-384}}=-\frac{3}{2}
So the solution to the system is (x,y,z)=(53,54,32)(x,y,z)=(\frac{5}{3},-\frac{5}{4},-\frac{3}{2})


Inverse Matrix

The inverse of matrix MM is M1M^{-1}, and satisfies M1M=IM^{-1}M=I, where II is the identity matrix
M1M^{-1} exists if and only ifdetM0\det{M}\ne0
If M1M^{-1} does not exist, the matrix is singular
The inverse matrix can be found in three ways: from the Adjugate Matrix, Gauss-Jordan Elimination/Row Reduction, or with a calculator

Adjugate Matrix

  1. Transpose the matrix (reflect each element across the main diagonal) (MTM^T)
  2. Find the 2x2 minor of each element
  3. Create a 3x3 matrix from the minors, changing signs based on the pattern
    [+++++]\begin{bmatrix}+&-&+\\-&+&-\\+&-&+\end{bmatrix}
  4. Divide the resulting matrix by detM\det{M}
Example 1.5

Find the inverse of M=[124400412124]M=\begin{bmatrix}-12&-4&4\\0&0&-4\\12&12&4\end{bmatrix}


  1. MT=[120124012444]M^T=\begin{bmatrix}-12&0&12\\-4&0&12\\4&-4&4\end{bmatrix}
  2. 01244=48,41244=64,4044=16\begin{vmatrix}0&12\\-4&4\end{vmatrix}=48, \begin{vmatrix}-4&12\\4&4\end{vmatrix}=-64, \begin{vmatrix}-4&0\\4&-4\end{vmatrix}=16
    01244=48,121244=96,12044=48\begin{vmatrix}0&12\\-4&4\end{vmatrix}=48, \begin{vmatrix}-12&12\\4&4\end{vmatrix}=-96, \begin{vmatrix}-12&0\\4&-4\end{vmatrix}=48
    012012=0,1212412=96,12040=0\begin{vmatrix}0&12\\0&12\end{vmatrix}=0, \begin{vmatrix}-12&12\\-4&12\end{vmatrix}=-96, \begin{vmatrix}-12&0\\-4&0\end{vmatrix}=0
  3. adj(M)=[4864164896480960]\text{adj}(M)=\begin{bmatrix}48&64&16\\-48&-96&-48\\0&96&0\end{bmatrix}
  4. MT=1detMadj(M)=1384[4864164896480960]=[48/38464/38416/38448/38496/38448/384096/3840]=[1/81/61/241/81/41/801/40]M^T=\frac{1}{\det{M}}\text{adj}(M)=\frac{1}{-384}\begin{bmatrix}48&64&16\\-48&-96&-48\\0&96&0\end{bmatrix}=\begin{bmatrix}-48/384&-64/384&-16/384\\48/384&96/384&48/384\\0&-96/384&0\end{bmatrix}=\begin{bmatrix}-1/8&-1/6&-1/24\\1/8&1/4&1/8\\0&-1/4&0\end{bmatrix}

Gauss-Jordan Elimination/Row Reduction

If you have an n×nn\times n matrix, append the n×nn\times n identity matrix to the right.
The goal is to use the following 3 rules to turn the original matrix into the identity matrix.
This will make the identity matrix turn into the inverse matrix.

Example 1.6: 2x2 Matrix

Find the inverse of [2315]\begin{bmatrix}2&3\\1&5\end{bmatrix} using Row Reduction


Append the identity matrix. The divider is added to differentiate the two matrices.
[23101501]\begin{bmatrix}2&3&\textcolor{#F79256}{|}&1&0\\1&5&\textcolor{#F79256}{|}&0&1\end{bmatrix}
Swap the two rows to get a 11 in the top left.
[15012310]\begin{bmatrix}1&5&\textcolor{#F79256}{|}&0&1\\2&3&\textcolor{#F79256}{|}&1&0\end{bmatrix}
Add 2-2 times the top row and add it to the bottom row
[150122(1)32(5)12(0)02(1)]=[15010712]\begin{bmatrix}1&5&\textcolor{#F79256}{|}&0&1\\2-2(1)&3-2(5)&\textcolor{#F79256}{|}&1-2(0)&0-2(1)\end{bmatrix}= \begin{bmatrix}1&5&\textcolor{#F79256}{|}&0&1\\0&-7&\textcolor{#F79256}{|}&1&-2\end{bmatrix}
Multiply the bottom row by 17-\frac{1}{7} to get the bottom row to be 0011
[150107771727]=[1501011727]\begin{bmatrix}1&5&\textcolor{#F79256}{|}&0&1\\\frac{0}{-7}&\frac{-7}{-7}&\textcolor{#F79256}{|}&\frac{1}{-7}&\frac{-2}{-7}\end{bmatrix}= \begin{bmatrix}1&5&\textcolor{#F79256}{|}&0&1\\0&1&\textcolor{#F79256}{|}&-\frac{1}{7}&\frac{2}{7}\end{bmatrix}
Finally subtract 55 times the bottom row from the top row to remove the 55
[15(0)55(1)05(17)15(27)011727]=[105737011727]\begin{bmatrix}1-5(0)&5-5(1)&\textcolor{#F79256}{|}&0-5(-\frac{1}{7})&1-5(\frac{2}{7})\\0&1&\textcolor{#F79256}{|}&-\frac{1}{7}&\frac{2}{7}\end{bmatrix}= \begin{bmatrix}1&0&\textcolor{#F79256}{|}&\frac{5}{7}&-\frac{3}{7}\\0&1&\textcolor{#F79256}{|}&-\frac{1}{7}&\frac{2}{7}\end{bmatrix}
So
[2315]1=[57371727]\begin{bmatrix}2&3\\1&5\end{bmatrix}^{-1}=\begin{bmatrix}\frac{5}{7}&-\frac{3}{7}\\-\frac{1}{7}&\frac{2}{7}\end{bmatrix}

Example 1.7: 3x3 Matrix

Find the inverse of [444412334]\begin{bmatrix}4&-4&4\\4&1&-2\\-3&-3&-4\end{bmatrix}


Append the identity matrix. The divider is added to differentiate the two matrices.
[444100412010334001]\begin{bmatrix}4&-4&4&\textcolor{#F79256}{|}&1&0&0\\4&1&-2&\textcolor{#F79256}{|}&0&1&0\\-3&-3&-4&\textcolor{#F79256}{|}&0&0&1\end{bmatrix}
Multiply the top row by 14\frac{1}{4}
[4444441400412010334001]=[1111400412010334001]\begin{bmatrix}\frac{4}{4}&\frac{-4}{4}&\frac{4}{4}&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\4&1&-2&\textcolor{#F79256}{|}&0&1&0\\-3&-3&-4&\textcolor{#F79256}{|}&0&0&1\end{bmatrix}= \begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\4&1&-2&\textcolor{#F79256}{|}&0&1&0\\-3&-3&-4&\textcolor{#F79256}{|}&0&0&1\end{bmatrix}
Subtract 44 times the top row from the middle row and add 33 times the top row from the bottom row
[111140044(1)14(1)24(1)04(14)14(0)04(0)3+3(1)3+3(1)4+3(1)0+3(14)0+3(0)1+3(0)]=[11114000561100613401]\begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\4-4(1)&1-4(-1)&-2-4(1)&\textcolor{#F79256}{|}&0-4(\frac{1}{4})&1-4(0)&0-4(0)\\-3+3(1)&-3+3(-1)&-4+3(1)&\textcolor{#F79256}{|}&0+3(\frac{1}{4})&0+3(0)&1+3(0)\end{bmatrix}= \begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\0&5&-6&\textcolor{#F79256}{|}&-1&1&0\\0&-6&-1&\textcolor{#F79256}{|}&\frac{3}{4}&0&1\end{bmatrix}
Add the bottom row to the middle row
[11114000+05+(6)6+(1)1+(34)1+00+10613401]=[111140001714110613401]\begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\0+0&5+(-6)&-6+(-1)&\textcolor{#F79256}{|}&-1+(\frac{3}{4})&1+0&0+1\\0&-6&-1&\textcolor{#F79256}{|}&\frac{3}{4}&0&1\end{bmatrix}= \begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\0&-1&-7&\textcolor{#F79256}{|}&-\frac{1}{4}&1&1\\0&-6&-1&\textcolor{#F79256}{|}&\frac{3}{4}&0&1\end{bmatrix}
Multiply the middle row by 1-1
[111140001(1)7(1)14(1)1(1)1(1)0613401]=[111140001714110613401]\begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\0&-1(-1)&-7(-1)&\textcolor{#F79256}{|}&-\frac{1}{4}(-1)&1(-1)&1(-1)\\0&-6&-1&\textcolor{#F79256}{|}&\frac{3}{4}&0&1\end{bmatrix}= \begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\0&1&7&\textcolor{#F79256}{|}&\frac{1}{4}&-1&-1\\0&-6&-1&\textcolor{#F79256}{|}&\frac{3}{4}&0&1\end{bmatrix}
Add 66 times the middle row to the bottom row
[111140001714110+6(0)6+6(1)1+6(7)34+6(14)0+6(1)1+6(1)]=[1111400017141100419465]\begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\0&1&7&\textcolor{#F79256}{|}&\frac{1}{4}&-1&-1\\0+6(0)&-6+6(1)&-1+6(7)&\textcolor{#F79256}{|}&\frac{3}{4}+6(\frac{1}{4})&0+6(-1)&1+6(-1)\end{bmatrix}= \begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\0&1&7&\textcolor{#F79256}{|}&\frac{1}{4}&-1&-1\\0&0&41&\textcolor{#F79256}{|}&\frac{9}{4}&-6&-5\end{bmatrix}
Multiply the bottom row by 141\frac{1}{41}
[111140001714110410414141(94)(141)641541]=[111140001714110019164641541]\begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\0&1&7&\textcolor{#F79256}{|}&\frac{1}{4}&-1&-1\\\frac{0}{41}&\frac{0}{41}&\frac{41}{41}&\textcolor{#F79256}{|}&(\frac{9}{4})(\frac{1}{41})&\frac{-6}{41}&\frac{-5}{41}\end{bmatrix}= \begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\0&1&7&\textcolor{#F79256}{|}&\frac{1}{4}&-1&-1\\0&0&1&\textcolor{#F79256}{|}&\frac{9}{164}&-\frac{6}{41}&-\frac{5}{41}\end{bmatrix}
Subtract 77 times the bottom row from the middle row
[111140007(0)17(0)77(1)147(9164)17(641)17(541)0019164641541]=[111140001011821416410019164641541]\begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\0-7(0)&1-7(0)&7-7(1)&\textcolor{#F79256}{|}&\frac{1}{4}-7(\frac{9}{164})&-1-7(-\frac{6}{41})&-1-7(-\frac{5}{41})\\0&0&1&\textcolor{#F79256}{|}&\frac{9}{164}&-\frac{6}{41}&-\frac{5}{41}\end{bmatrix}= \begin{bmatrix}1&-1&1&\textcolor{#F79256}{|}&\frac{1}{4}&0&0\\0&1&0&\textcolor{#F79256}{|}&-\frac{11}{82}&\frac{1}{41}&-\frac{6}{41}\\0&0&1&\textcolor{#F79256}{|}&\frac{9}{164}&-\frac{6}{41}&-\frac{5}{41}\end{bmatrix}
Add 11 times the middle row to the top row and subtract 11 times the bottom row to the top row
[1+001+101+0114+(1182)91640+141(641)0+(641)(541)01011821416410019164641541]=[10058274114101011821416410019164641541]\begin{bmatrix}1+0-0&-1+1-0&1+0-1&\textcolor{#F79256}{|}&\frac{1}{4}+(-\frac{11}{82})-\frac{9}{164}&0+\frac{1}{41}-(-\frac{6}{41})&0+(-\frac{6}{41})-(-\frac{5}{41})\\0&1&0&\textcolor{#F79256}{|}&-\frac{11}{82}&\frac{1}{41}&-\frac{6}{41}\\0&0&1&\textcolor{#F79256}{|}&\frac{9}{164}&-\frac{6}{41}&-\frac{5}{41}\end{bmatrix}= \begin{bmatrix}1&0&0&\textcolor{#F79256}{|}&\frac{5}{82}&\frac{7}{41}&-\frac{1}{41}\\0&1&0&\textcolor{#F79256}{|}&-\frac{11}{82}&\frac{1}{41}&-\frac{6}{41}\\0&0&1&\textcolor{#F79256}{|}&\frac{9}{164}&-\frac{6}{41}&-\frac{5}{41}\end{bmatrix}
So
[444412334]1=[58274114111821416419164641541]\begin{bmatrix}4&-4&4\\4&1&-2\\-3&-3&-4\end{bmatrix}^{-1}= \begin{bmatrix}\frac{5}{82}&\frac{7}{41}&-\frac{1}{41}\\-\frac{11}{82}&\frac{1}{41}&-\frac{6}{41}\\\frac{9}{164}&-\frac{6}{41}&-\frac{5}{41}\end{bmatrix}


Solving Linear System of Equations with Matrices

In a system of linear equations with MM being a 3x3 matrix, X=[xyz]X=\begin{bmatrix}x\\y\\z\end{bmatrix}, and AA being the constant column matrix, then from MX=AMX=A,
M1MX=X=M1AM^{-1}MX=X=M^{-1}A
In other words, multiplying the inverse matrix by the constant matrix yields the solutions.

Example 1.8

Solve the following system using an inverse matrix
12x4y+4z=210x+0y4z=612x+12y+4z=1 -12x-4y+4z=\textcolor{#F79256}{-21}\\ 0x+0y-4z=\textcolor{#F79256}{6}\\ 12x+12y+4z=\textcolor{#F79256}{-1}


The matrix form is
[124400412124][xyz]=[2161] \begin{bmatrix} -12&-4&4\\ 0&0&-4\\ 12&12&4 \end{bmatrix} \begin{bmatrix}x\\y\\z\end{bmatrix} =\begin{bmatrix} \textcolor{#F79256}{-21}\\ \textcolor{#F79256}{6}\\ \textcolor{#F79256}{-1} \end{bmatrix}
so the solution can be found with
[xyz]=[124400412124]1[2161] \begin{bmatrix}x\\y\\z\end{bmatrix}= \begin{bmatrix} -12&-4&4\\ 0&0&-4\\ 12&12&4 \end{bmatrix}^{-1} \begin{bmatrix} \textcolor{#F79256}{-21}\\ \textcolor{#F79256}{6}\\ \textcolor{#F79256}{-1} \end{bmatrix}
The inverse was found in Example 1.5 so we have
[xyz]=[1/81/61/241/81/41/801/40][2161]=[(21)/86/6(1)/2421/8+6/4+1/80(6)/4+0]=[5/35/43/2] \begin{bmatrix}x\\y\\z\end{bmatrix}= \begin{bmatrix} -1/8&-1/6&-1/24\\ 1/8&1/4&1/8\\ 0&-1/4&0 \end{bmatrix} \begin{bmatrix} \textcolor{#F79256}{-21}\\ \textcolor{#F79256}{6}\\ \textcolor{#F79256}{-1} \end{bmatrix}= \begin{bmatrix} -(\textcolor{#F79256}{-21})/8-\textcolor{#F79256}{6}/6-(\textcolor{#F79256}{-1})/24\\ \textcolor{#F79256}{-21}/8+\textcolor{#F79256}{6}/4+\textcolor{#F79256}{-1}/8\\ 0-(\textcolor{#F79256}{6})/4+0 \end{bmatrix}= \begin{bmatrix} 5/3\\ -5/4\\ -3/2 \end{bmatrix}

Alternatively, you can apply Gauss-Jordan Elimination to directly solve the system
Instead of appending the identity matrix, append the constant matrix.

Example 1.9

Solve the following system using Gauss-Jordan Elimination
12x4y+4z=210x+0y4z=612x+12y+4z=1 -12x-4y+4z=-21\\ 0x+0y-4z=6\\ 12x+12y+4z=-1


Create the matrix with the constants appended
[1244210046121241]\begin{bmatrix}-12&-4&4&\textcolor{#F79256}{|}&-21\\0&0&-4&\textcolor{#F79256}{|}&6\\12&12&4&\textcolor{#F79256}{|}&-1\end{bmatrix}
Multiply all three rows by 14-\frac{1}{4}
[124444421404044464124124441]=[3112140013233114]\begin{bmatrix}\frac{-12}{-4}&\frac{-4}{-4}&\frac{4}{-4}&\textcolor{#F79256}{|}&\frac{-21}{-4}\\\frac{0}{-4}&\frac{0}{-4}&\frac{-4}{-4}&\textcolor{#F79256}{|}&\frac{6}{-4}\\\frac{12}{-4}&\frac{12}{-4}&\frac{4}{-4}&\textcolor{#F79256}{|}&-1\end{bmatrix}= \begin{bmatrix}3&1&-1&\textcolor{#F79256}{|}&\frac{21}{4}\\0&0&1&\textcolor{#F79256}{|}&-\frac{3}{2}\\-3&-3&-1&\textcolor{#F79256}{|}&\frac{1}{4}\end{bmatrix}
Add 11 times the second row to the first and third row
[3+01+01+1214+(32)001323+03+01+114+(32)]=[3101540013233054]\begin{bmatrix}3+0&1+0&-1+1&\textcolor{#F79256}{|}&\frac{21}{4}+(-\frac{3}{2})\\0&0&1&\textcolor{#F79256}{|}&-\frac{3}{2}\\-3+0&-3+0&-1+1&\textcolor{#F79256}{|}&\frac{1}{4}+(-\frac{3}{2})\end{bmatrix}= \begin{bmatrix}3&1&0&\textcolor{#F79256}{|}&\frac{15}{4}\\0&0&1&\textcolor{#F79256}{|}&-\frac{3}{2}\\-3&-3&0&\textcolor{#F79256}{|}&-\frac{5}{4}\end{bmatrix}
Multiply the bottom row by 13-\frac{1}{3}
[31015400132333303(54)(13)]=[31015400132110512]\begin{bmatrix}3&1&0&\textcolor{#F79256}{|}&\frac{15}{4}\\0&0&1&\textcolor{#F79256}{|}&-\frac{3}{2}\\\frac{-3}{-3}&\frac{-3}{-3}&\frac{0}{-3}&\textcolor{#F79256}{|}&(-\frac{5}{4})(-\frac{1}{3})\end{bmatrix}= \begin{bmatrix}3&1&0&\textcolor{#F79256}{|}&\frac{15}{4}\\0&0&1&\textcolor{#F79256}{|}&-\frac{3}{2}\\1&1&0&\textcolor{#F79256}{|}&\frac{5}{12}\end{bmatrix}
Subtract 11 times the bottom row from the top row
[31110015451200132110512]=[20010300132110512]\begin{bmatrix}3-1&1-1&0-0&\textcolor{#F79256}{|}&\frac{15}{4}-\frac{5}{12}\\0&0&1&\textcolor{#F79256}{|}&-\frac{3}{2}\\1&1&0&\textcolor{#F79256}{|}&\frac{5}{12}\end{bmatrix}= \begin{bmatrix}2&0&0&\textcolor{#F79256}{|}&\frac{10}{3}\\0&0&1&\textcolor{#F79256}{|}&-\frac{3}{2}\\1&1&0&\textcolor{#F79256}{|}&\frac{5}{12}\end{bmatrix}
Multiply the top row by 12\frac{1}{2}
[220202(103)(12)00132110512]=[1005300132110512]\begin{bmatrix}\frac{2}{2}&\frac{0}{2}&\frac{0}{2}&\textcolor{#F79256}{|}&(\frac{10}{3})(\frac{1}{2})\\0&0&1&\textcolor{#F79256}{|}&-\frac{3}{2}\\1&1&0&\textcolor{#F79256}{|}&\frac{5}{12}\end{bmatrix}= \begin{bmatrix}1&0&0&\textcolor{#F79256}{|}&\frac{5}{3}\\0&0&1&\textcolor{#F79256}{|}&-\frac{3}{2}\\1&1&0&\textcolor{#F79256}{|}&\frac{5}{12}\end{bmatrix}
Subtract the top row from the bottom row
[100530013211100051253]=[100530013201054]\begin{bmatrix}1&0&0&\textcolor{#F79256}{|}&\frac{5}{3}\\0&0&1&\textcolor{#F79256}{|}&-\frac{3}{2}\\1-1&1-0&0-0&\textcolor{#F79256}{|}&\frac{5}{12}-\frac{5}{3}\end{bmatrix}= \begin{bmatrix}1&0&0&\textcolor{#F79256}{|}&\frac{5}{3}\\0&0&1&\textcolor{#F79256}{|}&-\frac{3}{2}\\0&1&0&\textcolor{#F79256}{|}&-\frac{5}{4}\end{bmatrix}
Swap the second and third row
[100530105400132]\begin{bmatrix}1&0&0&\textcolor{#F79256}{|}&\frac{5}{3}\\0&1&0&\textcolor{#F79256}{|}&-\frac{5}{4}\\0&0&1&\textcolor{#F79256}{|}&-\frac{3}{2}\end{bmatrix}
The left side is now the identity matrix and the right side represents the solution
(x,y,z)=(53,54,32)(x,y,z)=(\frac{5}{3},-\frac{5}{4},-\frac{3}{2})


Eigenvalues and Eigenvectors

Matrices are linear transformations, meaning they take the coordinate plane and stretch, rotate, and/or sheer it (see this video for an animation)
Some linear transformations have the same effect as a constant, only stretching it

Mathematical Example

Suppose you have a linear transformation (matrix) [1232]\begin{bmatrix}1&2\\3&2\end{bmatrix}
Applying this transformation to the vector [12]\begin{bmatrix}1\\2\end{bmatrix} results in the vector
[1232][12]=[1(1)+2(2)3(1)+2(2)]=[57]\begin{bmatrix}1&2\\3&2\end{bmatrix}\begin{bmatrix}1\\2\end{bmatrix}=\begin{bmatrix}1(1)+2(2)\\3(1)+2(2)\end{bmatrix}=\begin{bmatrix}5\\7\end{bmatrix}
This is clearly pointing in a different direction.
However, applying the transformation to the vector [23]\begin{bmatrix}2\\3\end{bmatrix} results in the vector
[1232][23]=[1(2)+2(3)3(2)+2(3)]=[812]=4[23]\begin{bmatrix}1&2\\3&2\end{bmatrix}\begin{bmatrix}2\\3\end{bmatrix}=\begin{bmatrix}1(2)+2(3)\\3(2)+2(3)\end{bmatrix}=\begin{bmatrix}8\\12\end{bmatrix}=4\begin{bmatrix}2\\3\end{bmatrix}
This is clearly the same vector stretched by a factor of 4.
Thus, linear transformations can have the same effect as a constant when applied to certain vectors.

Solving for eigenvalues and eigenvectors

If we have a linear transformation (matrix) AA, vectorx\vec{x}, and constantλ\lambda, we must have
Ax=λxA\vec{x}=\lambda \vec{x}
This indicates that multiplying a vector by AA has the same effect as λ\lambda, so λ\lambda is the eigenvalue and x\vec{x} is the corresponding eigenvector.
We subtract both sides of the equation by λx\lambda x and factor so that
(AλI)x=0AλIx=0(A-\lambda I)\vec{x}=0\rightarrow |A-\lambda I||\vec{x}|=0
Note that because we cannot subtract a matrix by a number, we multiply the number by the identity matrixII so that we have a matrix minus a matrix.
So either AλI=0|A-\lambda I|=0 or x=0|\vec{x}|=0. Having x=0|\vec{x}|=0 is pointless since that's just the 00-vector, so AλI=0|A-\lambda I|=0.
Write the expression for the determinant in terms of λ\lambda and solve for when it equals 00. This expression is called the characteristic polynomial. That solves for λ\lambda.
Then multiply out (AλI)x(A-\lambda I)\vec{x}, where x=<x1,x2,>\vec{x} = <x_1, x_2,\cdots>, and attempt to solve the system of equations.
One is likely a multiple of the other, so the best you can do is write one part of x\vec{x} in terms of other parts of x\vec{x}, so the eigenvector will be parametrized by a parameter tt.

Process Summary

  1. Solve for λ\lambda using AλI=0|A-\lambda I|=0\rightarrow eigenvalues
  2. Expand(AλI)x(A-\lambda I)\vec{x}, assuming x=<x1,x2>\vec{x}=<x_1,x_2\cdot>
  3. Simplify as best as possible the system of equations created from (AλI)x=0(A-\lambda I)\vec{x}=0\rightarrow eigenvectors
Example 1.10

Find the eigenvalues and eigenvectors for A=[1232]A=\begin{bmatrix}1&2\\3&2\end{bmatrix}


We first find the characteristic polynomial
AλI=1λ232λ=(1λ)(2λ)2(3)=λ23λ4=(λ4)(λ+1)=0|A-\lambda I|=\begin{vmatrix}1-\lambda&2\\3&2-\lambda\end{vmatrix}=(1-\lambda)(2-\lambda)-2(3)=\lambda^2-3\lambda-4=(\lambda-4)(\lambda+1)=0
So, the eigenvalues are λ=4\lambda=4 and λ=1\lambda=-1
We now have two cases, one for each eigenvalue:

In conclusion, for any real tt, we have:

Side Note

The product of the eigenvalues equals the determinant:
λ1λ2=4(1)=4=1(2)2(3)=det(A)\lambda_1\lambda_2=4(-1)=-4=1(2)-2(3)=\det(A)

Example 1.11

Find the eigenvalues and eigenvectors of [012654003]\begin{bmatrix}0&1&-2\\-6&5&-4\\0&0&3\end{bmatrix}


The characteristic polynomial is 0λ1265λ4003λ=(3λ)λ165λ=(3λ)(λ25λ+6)=(3λ)(λ3)(λ2)=0\begin{vmatrix}0-\lambda&1&-2\\-6&5-\lambda&-4\\0&0&3-\lambda\end{vmatrix}=(3-\lambda)\begin{vmatrix}-\lambda&1\\-6&5-\lambda\end{vmatrix}=(3-\lambda)(\lambda^2-5\lambda+6)=(3-\lambda)(\lambda-3)(\lambda-2)=0
So there are only two eigenvalues, λ=2\lambda=2 and λ=3\lambda=3

In conclusion, for any real tt and ss:


Symmetrical and Orthogonal Matrices

The transpose (ATA^T) is a matrix where rows become columns
element aija_{ij} in matrix AA is element ajia_{ji} in matrix ATA^T

Properties of the Transpose

let AA and BB be matrices and kk a constant

If A=ATA=A^T, then matrix AA is symmetric
orthogonal vectors have a dot product of 00, i.e. are 9090^\circ apart
Theorem about symmetric matrices

In a symmetric matrix, any two eigenvectors of distinct eigenvalues are orthogonal

For a symmetrical matrix AA, let λ1\lambda_1 have eigenvector x1\vec{x}_1 and λ2\lambda_2 have eigenvector x2\vec{x}_2, with λ1λ2\lambda_1\ne\lambda_2.
Then we have
λ2(x1x2)=λ2x1x2T=x1λ2x2T=x1Ax2T\lambda_2(\vec{x}_1\cdot\vec{x}_2)=\lambda_2\vec{x}_1\vec{x}_2^T=\vec{x}_1\lambda_2\vec{x}_2^T=\vec{x}_1A\vec{x}_2^T
Since A=ATA=A^T,
x1Ax2T=x1ATx2T=(Ax1T)Tx2T=(λ1x1T)Tx2T=λ1(x1T)Tx2T=λ1(x1x2T)=λ1(x1x2)\vec{x}_1A\vec{x}_2^T=\vec{x}_1A^T\vec{x}_2^T=(A\vec{x}_1^T)^T\vec{x}_2^T=(\lambda_1\vec{x}_1^T)^T\vec{x}_2^T=\lambda_1(\vec{x}_1^T)^T\vec{x}_2^T=\lambda_1(\vec{x}_1\vec{x}_2^T)=\lambda_1(\vec{x}_1\cdot\vec{x}_2)
So, lambda1(x1x2)=λ2(x1x2)(λ1λ2)(x1x2)=0lambda_1(\vec{x}_1\cdot\vec{x}_2)=\lambda_2(\vec{x}_1\cdot\vec{x}_2)\rightarrow(\lambda_1-\lambda_2)(\vec{x}_1\cdot\vec{x}_2)=0
Since λ1λ20\lambda_1-\lambda_2\ne0, x1x2=0\vec{x}_1\cdot\vec{x}_2=0, meaning the two vectors are orthogonal. \blacksquare

Let diag(a11,a22,,ann)diag(a_{11},a_{22},\cdots, a_{nn}) denote an n×nn\times n matrix where every entry is 00 except the diagonals, which are a11,a22,,anna_{11}, a_{22},\cdots, a_{nn} respectively
Then an n×nn\times n matrix AA with eigenvalues λ1,λ2,,λn\lambda_1,\lambda_2,\cdots,\lambda_n is similar to diag(λ1,λ2,,λn)diag(\lambda_1,\lambda_2,\cdots,\lambda_n)

If MMT=IMM^T=I, or equivalently, M1=MTM^{-1}=M^T, MM is called orthogonal

Example 1.12

Prove that the rotation transformation matrix, M=[cosθsinθsinθcosθ]M=\begin{bmatrix}\cos\theta&-\sin\theta\\\sin\theta&\cos\theta\end{bmatrix}, is orthogonal.


If MM is orthogonal, then MMT=IMM^T=I
MMT=[cosθsinθsinθcosθ][cosθsinθsinθcosθ]=[(cosθ)2+(sinθ)2cosθsinθcosθsinθsinθcosθsinθcosθsin2θ+cos2θ]=[1001]=IMM^T=\begin{bmatrix}\cos\theta&-\sin\theta\\\sin\theta&\cos\theta\end{bmatrix}\begin{bmatrix}\cos\theta&\sin\theta\\-\sin\theta&\cos\theta\end{bmatrix}=\begin{bmatrix}(\cos\theta)^2+(-\sin\theta)^2&\cos\theta\sin\theta-\cos\theta\sin\theta\\\sin\theta\cos\theta-\sin\theta\cos\theta&\sin^2\theta+\cos^2\theta\end{bmatrix}=\begin{bmatrix}1&0\\0&1\end{bmatrix}=I
Since we have shown that MMT=IMM^T=I, MM is an orthogonal matrix. \blacksquare